<%-- 
    Document   : register
    Created on : 14-déc.-2012, 11:17:05
    Author     : Anthares
--%>

<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="emptyFields" required="true" type="java.lang.Boolean" %>
<%@attribute name="invalidFields" required="true" type="java.lang.Boolean" %>

<fmt:setLocale value="${locale}"/>
<fmt:setBundle basename="Languages.lang"/>

<core:if test="${emptyFields!=null and emptyFields}"><h1 class="error-msg"><fmt:message key="form.register.error.empty"/></h1></core:if>
<core:if test="${invalidFields!=null and invalidFields}"><h1 class="error-msg"><fmt:message key="form.register.error.invalid"/></h1></core:if>

<form id="register-form" method="POST" action="<core:url value="/register/confirm"/>">
    <input class="top" type="text" name="nom" placeholder="<fmt:message key="form.register.name.hint"/>"
           data-validation-engine="validate[required,minSize[2]]"
           data-prompt-position="centerRight"
           data-errormessage-value-missing="<fmt:message key="form.register.name.error.required"/>"
           data-errormessage-range-underflow="<fmt:message key="form.register.name.error.value"/>!"/>
    <input type="text" name="prenom" placeholder="<fmt:message key="form.register.fname.hint"/>" 
           data-validation-engine="validate[required,minSize[2]]"
           data-prompt-position="centerRight"
           data-errormessage-value-missing="<fmt:message key="form.register.fname.error.required"/>"
           data-errormessage-range-underflow="<fmt:message key="form.register.fname.error.value"/>"/>
    <input type="text" name="email" placeholder="<fmt:message key="form.register.email.hint"/>" 
           data-validation-engine="validate[required,custom[email]]"
           data-prompt-position="centerRight"
           data-errormessage-value-missing="<fmt:message key="form.register.email.error.required"/>"
           data-errormessage="<fmt:message key="form.register.email.error.value"/>"/>
    <input id="register-password" type="password" name="password" placeholder="<fmt:message key="form.register.pass.hint"/>" 
           data-validation-engine="validate[required,minSize[8],custom[onlyLetterNumber]]"
           data-prompt-position="centerRight"
           data-errormessage-value-missing="<fmt:message key="form.register.pass.error.required"/>"
           data-errormessage-range-underflow="<fmt:message key="form.register.pass.error.value"/>"/>
    <input type="password" name="password2" placeholder="<fmt:message key="form.register.conf.hint"/>" 
           data-validation-engine="validate[required,minSize[8],equals[register-password],custom[onlyLetterNumber]]"
           data-prompt-position="centerRight"
           data-errormessage-value-missing="<fmt:message key="form.register.conf.error.required"/>"
           data-errormessage-pattern-mismatch="<fmt:message key="form.register.conf.error.match"/>"
           data-errormessage-range-underflow="<fmt:message key="form.register.conf.error.value"/>"/>
    <input class="bottom-left button" type="reset" value="<fmt:message key="form.register.reset"/>"/><input class="bottom-right button" type="submit" value="<fmt:message key="form.register.submit"/>"/>
</form>
